/*
 * @Author: 郭招娣 10615594+guo-zhaodi@user.noreply.gitee.com
 * @Date: 2022-10-24 20:25:08
 * @LastEditors: 郭招娣 10615594+guo-zhaodi@user.noreply.gitee.com
 * @LastEditTime: 2022-10-31 10:49:36
 * @FilePath: \宏烨找房\user\demo\src\page\My\index.jsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import React, { useEffect, useState } from 'react'
import { Arrow } from '@react-vant/icons';
import { Button } from 'react-vant';
import { useSelector,useDispatch } from 'react-redux'
import { useNavigate } from 'react-router-dom';
import { noLoginAction } from '../../store/loginAction'

import './index.css';
 const My=()=> {

     const dispatch=useDispatch()
     const navigate = useNavigate()
     const user = useSelector((state) => state.user)
     const isLogin = useSelector((state) => state.isLogin)
     console.log(user)
    console.log(isLogin)

     const back=()=>{
         dispatch(noLoginAction(false));
            navigate('/login')
     }
  return (
    <div className='content'>
        <div className="top">
              <span>我  &emsp; 的</span>
        </div>
        <div className='user'>
            <div className='userOne'>
                <dl>
                    <dt>
                        <img src={user.img} alt=""/>
                    </dt>
                    <dd>
                        <p>{user.username}</p>
                        <p>{user.tel}</p>
                    </dd>
                </dl>
            </div>
            <div className='userTwo'>
                <dl>
                    <dt>
                        <img src={require('../../img/my1.png')} alt="" />
                    </dt>
                    <dd>我的发布</dd>
                </dl>
                  <dl>
                      <dt>
                          <img src={require('../../img/my2.png')} alt="" />
                      </dt>
                      <dd>收藏</dd>
                  </dl>
                  <dl>
                      <dt>
                          <img src={require('../../img/my3.png')} alt="" />
                      </dt>
                      <dd>浏览历史</dd>
                  </dl>
            </div>
        </div>

        <div className="my">
            <div className='myOne'>
                <span>支付明细</span>
                  <span><Arrow /></span>
            </div>
            <div className='myTwo'>
                  <span>问题反馈</span>
                  <span><Arrow /></span>
            </div>
            <div className='myThree'>
                  <span>联系客服</span>
                  <span><Arrow /></span>
            </div>
        </div>

          <Button round type='danger' className='btn' onClick={()=>back()}>
              退出登录
          </Button>
    </div>
  )
}
export default My;